$(document).ready(function(){
	$('#loginBtn').click(function(){
		var userName = $('#username').val();
		var password = $('#password').val();
		if(userName && password){
			$.ajax({
				type: 'get',
				url: '/user/login',
				data: {
					userName: userName,
					userPass: password
				},
				success: function(data){
					if(data.code == 0){
						window.location.href = '/login/success';
					}else if(data.code == 1){
						window.location.href = '/user/page/register';
					}
				}
			});
		}
	});
});